<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head th:replace="admin/_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <link rel="stylesheet" href="../../static/semantis-ui/semantic.min.css">
    <script type="text/javascript" src="../../static/semantis-ui/jquery-3.6.0.js"></script>
    <script src="../../static/semantis-ui/semantic.min.js"></script>
    <link rel="stylesheet" href="../../static/css/me.css">
    <title>标签管理</title>
</head>
<body>
<!--导航-->
<!--segment反转 inverted平铺 导航栏-->
<nav class="ui segment inverted attached segment me-padded-tb-mini bg">
    <!--放在一个container中-->
    <div class="ui container ">
        <!--里面的菜单   stackable适应手机-->
        <div class="ui inverted stackable menu bg">
            <h2 class="ui teal header item ">HJ&nbsp&nbspblog</h2>
            <a href="#" th:href="@{/admin/blogs}" class="m-item item m-mobile-hide"><i class="m-margin-tb-menu icon home"></i>首页</a>
            <a href="#" th:href="@{/admin/types}" class="m-item item m-mobile-hide"><i class="m-margin-tb-menu folder open outline icon"></i>分类</a>
            <a href="#" th:href="@{/admin/tags}" class="m-item item m-mobile-hide"><i class="m-margin-tb-menu edit outline icon"></i>标签</a>
            <div class="right menu">
                <!--th:replace="admin/_fragments :: content"  调用_fragments :: content-->
                <div class="ui dropdown item" th:replace="admin/_fragments :: content">
                    <div class="text">
                        <img src="../../static/image/小.png" alt="" class="ui avatar image">
                        王锡豪
                    </div>
                    <i class="dropdown icon"></i>
                    <div class="menu">
                        <a href="#" class="item">注销</a>
                    </div>
                </div>
            </div>

        </div>
    </div>
    <!--三条杠 更多按钮-->
    <a href="#" class="ui icon button menu toggle m-right-top bg white-font m-mobile-show">
        <i class="sidebar icon"></i>
    </a>
</nav>
<div class="ui attached pointing menu">
    <div class="ui container">
        <div class="right menu">

            <a href="#" th:href="@{/admin/tags/input}"   class="item">新增</a>
            <a href="#" th:href="@{/admin/tags}" class="active teal item">列表</a>

        </div>

    </div>
</div>


<!--中间-->
<div class="m-padded-d-mass">
    <div class="m-container-small m-padded-tb-big">
        <div class="ui container">
            <div class="ui success message" th:unless="${#strings.isEmpty(message)}">
                <i class="close icon"></i>
                <div class="header">提示:</div>
                <!--接收后端传过来的提示信息  -->
                <p th:text="${message}">操作成功！</p>
            </div>

            <!--表格  celled网格-->
            <table class="ui celled table" >
                <thead>
                <tr>
                    <th></th>
                    <th>名称</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="tag,iterStat : ${page.content}">
                    <!--th:each="type : ${page.content}}" 使用thymeleaf拿到type  type就是page的key里面的content  type,iterStat是自定义的量-->
                    <td th:text="${iterStat.count}">1</td>
                    <!--<!-拿到name&ndash;&gt;-->
                    <td th:text="${tag.name}">刻意练习清单</td>
                    <td>
                        <!--@{/admin/types/{id}/input(id=${type.id})}传值 给types-inpput页面  之后在types-inpput里面会判断-->
                        <a href="#" th:href="@{/admin/tags/{id}/input(id=${tag.id})}" class="ui mini button">&nbsp;&nbsp;&nbsp;&nbsp;编    辑&nbsp;&nbsp;&nbsp;&nbsp;</a>
                        <a href="#" th:href="@{/admin/tags/{id}/delete(id=${tag.id})}" class="ui button mini red" data-tooltip="确认删除吗？" >&nbsp;&nbsp;&nbsp;&nbsp;删    除&nbsp;&nbsp;&nbsp;&nbsp;</a>

                    </td>
                </tr>
                </tbody>

                <tfoot>
                <tr>
                    <th colspan="6">
                        <!--th:if="${page.totalPages}>1"页数大于一显示上一页下一页-->
                        <div th:if="${page.totalPages}>1" class="ui pagination menu">
                            <a th:href="@{/admin/tags(page=${page.number}-1)}" class=" item" th:unless="${page.first}">上一页</a>
                            <a th:href="@{/admin/tags(page=${page.number}+1)}" class=" item"  th:unless="${page.last}">下一页</a>
                        </div>
                        <a href="#" th:href="@{/admin/tags/input}" class="ui mini right floated teal basic button">新增</a></th>
                </tr>
                </tfoot>
            </table>


        </div>
    </div>


    <br/>
</div>

<!--底部      m-padded-d-mass间隔-->
<footer class="ui segment inverted vertical segment m-padded-d-mass bg">
    <!--container容器 center aligned居中-->
    <div class="ui center aligned container bg">
        <!--grid会把一些布局分为12列  devided加线 -->
        <div class="ui inverted divided grid bg">
            <div class="three wide column m-opacity-mini m-text-space m-text-thin m-text-lined">
                <div class="ui inverted link list bg">
                    <img src="./static/image/wo.jpg" alt="" class="ui rounded image" style="width:110px">

                </div>
            </div>
            <div class="three wide column m-opacity-mini m-text-space m-text-thin m-text-lined">
                <h4 class="ui inverted header">最新博客</h4>
                <div class="ui inverted link list ">
                    <a href="#" class="item">会飞的羊</a>
                    <a href="#" class="item">会飞的羊</a>
                    <a href="#" class="item">会飞的羊</a>
                </div>
            </div>
            <div class="three wide column m-opacity-mini m-text-space m-text-thin m-text-lined">
                <h4 class="ui inverted header">联系我吖</h4>
                <div class="ui inverted link list">
                    <a href="#" class="item">QQ:822021336</a>
                    <a href="#" class="item">邮箱：xihao.luck@qq.com</a>
                    <a href="#" class="item"></a>
                </div>
            </div>
            <div class="seven wide column">
                <h4 class="ui inverted header m-opacity-mini m-text-space m-text-thin m-text-lined">最新博客</h4>
                <p class="m-opacity-mini m-text-space m-text-thin m-text-lined">
                    这是我的个人博客，用于记录我在网上收集的文章，自己的代码笔记，和优秀的文案等等。欢迎大家关注！</p>
            </div>
        </div>
        <div class="ui inverted section divider m-opacity-mini m-text-space m-text-thin m-text-lined "></div>
        <p class="m-opacity-mini m-text-space m-text-thin m-text-lined">Copyright © 2021-2022 会飞的羊 </p>
    </div>

</footer>


<!--jquery-->

<script>
    // <!--点击.menu.toggle按钮加入m-mobile-hide样式-->
    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hide')
    });

    $('.ui.dropdown')
        .dropdown()
    ;
//    关闭提示框
    $('.message .close')
        .on('click',function () {
            $(this)
                .closest('.message')
                .transition('fade');
        });



</script>
</body>
</html>